package org.example.mybatisplus.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.example.mybatisplus.bean.Emp;
import org.example.mybatisplus.mapper.EmpMapper;
import org.example.mybatisplus.service.EmpService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class EmpServiceImpl extends ServiceImpl<EmpMapper, Emp> implements EmpService {
    @Override
    @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
    public void piliangcaozuo(List<Emp> list) {
        list.forEach(emp -> {
            updateById(emp);
        });
    }
}
